#ifndef __PROGRAM_H_
#define __PROGRAM_H_

#include "../../API/Common/Typedefs.h"
#include "Settings.h"
#include "../Messaging/Broker.h"
#include "../Tasking/ThreadPool.h"

using namespace skelepp::Core::Messaging;
using namespace skelepp::Core::Tasking;

namespace skelepp {
	namespace Core {
		namespace Application {
			class Program {
			private:
				Program(void);
				~Program(void);

				static Program *_instance;

				friend class Cleanup;
				class Cleanup {
					public:
						~Cleanup(void);
				};
		
				bool _running;
				
				Settings *_settings;
				ThreadPool *_thread_pool;
				Broker *_broker;

			public:
				static Program *get(void);

				Settings *get_settings(void) {
					return _settings;
				}

				ThreadPool *get_thread_pool(void) {
					return _thread_pool;
				}

				Broker get_broker(void) {
					return *_broker;
				}

				void start(void);
				void stop(void);

				bool is_running(void);
			};
		}
	}
}


#endif